using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;

namespace TRAnimation
{
    public class Keyframe : IComparable
    {
        int boneIndex;
        TimeSpan time;
        Matrix transform;

        public TimeSpan Time
        {
            get { return time; }
            set { time = value; }
        }

        public int Bone
        {
            get { return boneIndex; }
            set { boneIndex = value; }
        }

        public Matrix Transform
        {
            get { return transform; }
            set { transform = value; }
        }

        public Keyframe(TimeSpan time, int boneIndex, Matrix transform)
        {
            this.time = time;
            this.boneIndex = boneIndex;
            this.transform = transform;
        }

        public int CompareTo(object obj)
        {
            Keyframe keyframe = obj as Keyframe;
            if (obj == null)
                throw new ArgumentException("Object is not a keyframe!");

            return time.CompareTo(keyframe.Time);
        }
    }
}
